label: Be more defensive against non-existant focus_link
authorTimm Bäder <mail@baedert.org>
Thu, 30 Apr 2020 08:03:11 +0000 (10:03 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 5 May 2020 06:20:10 +0000 (08:20 +0200)
gtk/gtklabel.c

index 22382ed5e5fa819fea33d8ed4349fcda5dc64c39..a26e6265aa5cac94136a29559b92364fcdab4b1e 100644 (file)
@@ -3849,8 +3849,14 @@ gtk_label_focus (GtkWidget        *widget,
       int new_index = -1;
       int i;
 
+      if (info->n_links == 0)
+        goto out;
+
       focus_link = gtk_label_get_focus_link (self, &focus_link_index);
 
+      if (!focus_link)
+        goto out;
+
       switch (direction)
         {
         case GTK_DIR_TAB_FORWARD: